#ifndef _EDITOR_PROTOCOL_H_
#define _EDITOR_PROTOCOL_H_

#include <SFML/Network.hpp>
#include <string>
#include <map>

class Editor
{
public:
	enum MessageType
	{
		EventMessage,
		ConsoleMessage,
		EditorMessage
	};

	enum CommandType
	{
		AssignScript,
		RunScriptByID,
		RunScript
	};

	Editor();
	~Editor();
	bool connect(const char *host, unsigned short port);
	void sendEvent(sf::Event& ev);
	void update();
private:
	wstring script;
	SquirrelObject root;
	std::map<sf::Uint16,SquirrelObject> functions;
	sf::SocketTCP connection;
	sf::Packet packet;
};

#endif